package com.loyal.loyalerp.humenresource.kaoqinMonth.util;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.loyal.loyalerp.basedata.company.mapper.GyCompanyMapper;

public class CompanyIdSerialize extends JsonSerializer<Integer> {
	
	@Autowired
	GyCompanyMapper companyMapper;

	@Override
	public void serialize(Integer value, JsonGenerator jg, SerializerProvider provider)
			throws IOException, JsonProcessingException {
		jg.writeString(companyMapper.selectByPrimaryKey(value).getCompanyname());
		
	}

}
